import { Module } from '@nestjs/common';
import { McpModule as MCP, McpTransportType } from '@rekog/mcp-nest';
import { WeatherApiController } from './weather-api/weather-api.controller';
import { ConfigModule } from '@nestjs/config';
import { AcquiresCurrentTimeController } from './acquires_current_time/acquires_current_time.controller';
import { NewsController } from './news/news.controller';
import { PictureToolController } from './picture_tool/picture_tool.controller';

@Module({
  imports: [
    ConfigModule.forRoot({
      isGlobal: true,
      envFilePath: '.env'
    }),
    MCP.forRoot({
      name: 'nestjs-mcp',
      version: '0.0.1',
      sse: {
        pingEnabled: true,
        pingIntervalMs: 30000
      },
      transport: process.env.TRANSPORT === 'SSE' ? McpTransportType.SSE : McpTransportType.STDIO
    })
  ],
  controllers: [
    WeatherApiController,
    AcquiresCurrentTimeController,
    NewsController,
    PictureToolController
  ]
})
export class McpModule {}
